#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cstring>
using namespace std;
const int INF=0x3f3f3f3f;
const int N=2100;
int n,m;
vector<pair<int,double>> edge[N];
double dp[N];
int vis[N];
struct cmp{
	bool operator ()(pair<int,double>& p1,pair<int,double>& p2)
	{
		if(p1.second==p2.second)
			return p1.first>p2.first;
		return p1.second<p2.second;
	}
};
void dijkstra(int x)
{
	dp[x]=1;
	priority_queue<pair<int,double>,vector<pair<int,double>>,cmp> q;
	q.push({x,1});
	while(q.size())
	{
		int r=q.top().first;
		q.pop();
		vis[r]=1;
		for(auto& e:edge[r])
		{
			if(vis[e.first])
				continue;
			if(dp[e.first]<dp[r]*(1-e.second*0.01))
			{
				dp[e.first]=dp[r]*(1-e.second*0.01);
				q.push({e.first,dp[e.first]});
			}
		}
	}
	
}
int main()
{
	cin>>n>>m;
	
	for(int i=0;i<m;i++)
	{
		int x,y;
		double z;
		cin>>x>>y>>z;
		edge[x].push_back({y,z});
		edge[y].push_back({x,z});
	}
	memset(dp,0,sizeof(dp));
	memset(vis,0,sizeof(vis));
	

	int a,b;
	cin>>a>>b;
	dijkstra(a);
	printf("%.8lf",100.00/dp[b]);
	
	return 0;
}
